IF OBJECT_ID('ssf.job_get_info') IS NOT NULL
	DROP FUNCTION ssf.job_get_info
GO

CREATE FUNCTION ssf.job_get_info (
	@job_id UNIQUEIDENTIFIER
)
RETURNS TABLE
AS
/*
<object_header>

<object_summary>
	<purpose><![CDATA[
Return job info from sysjobs for the given job_id.
	]]></purpose>
</object_summary>

</object_header>
*/

	RETURN (
		SELECT @job_id AS job_id
			, name AS job_name
			, [enabled]
			, [description] AS job_description
			, start_step_id
			, delete_level
			, date_created
			, date_modified
		FROM msdb.dbo.sysjobs WITH (NOLOCK)
		WHERE job_id = @job_id
	)
GO
